package com.interesting.client.bean;

import android.os.Parcel;
import android.os.Parcelable;

/** 信息内容 */
public class Message implements Parcelable {
	/** 信息 id */
	private String id;

	/** 信息类别 */
	private String mesgType;

	/** 发送者id */
	private String authorId;

	/** 发送者头像 */
	private String authorIcon="";

	/** 发送者 昵称 */
	private String author;

	/** 发送者 信息内容 */
	private String content;

	/** 信息图片 */
	private String imgPath;

	/** mini图片 */
	private String minImgPath;
	private int status=0;
	private int isFirstChecked = 1;

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public boolean getIsFirstChecked() {
		if (this.isFirstChecked == 1)
			return true;
		else
			return false;
	}

	public void setIsFirstChecked(boolean FirstChecked) {
		if (FirstChecked)
			this.isFirstChecked = 1;
		else
			this.isFirstChecked = 0;
	}

	/** 被赞数目 */
	private int ntop;

	/**
	 * 是否被赞 0：未选中--- 1：选中
	 */
	private int istop = 0;
	/** 被鄙视 数目 */
	private int ndown;

	/**
	 * 是否被鄙视 0：未选中 --1：选中
	 */
	private int isdown = 0;

	/** 用于标记被审核内容 */
	private String examine;
	/**
	 * 用于标记是否被收藏 0未收藏 1收藏
	 */
	private int collected = 0;

	/** 发表时间 */
	private String nptime;

	/** 审核状态 */
	private String nstate;

	public String getId() {
		return id;
	}

	public String getNptime() {
		return nptime;
	}

	public void setNptime(String nptime) {
		this.nptime = nptime;
	}

	public String getNstate() {
		return nstate;
	}

	public void setNstate(String nstate) {
		this.nstate = nstate;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getMesgType() {
		return mesgType;
	}

	public void setMesgType(String mesgType) {
		this.mesgType = mesgType;
	}

	public String getAuthorId() {
		return authorId;
	}

	public void setAuthorId(String authorId) {
		this.authorId = authorId;
	}

	public String getAuthorIcon() {
		return authorIcon;
	}

	public void setAuthorIcon(String authorIcon) {
		this.authorIcon = authorIcon;
	}

	public String getAuthor() {
		return author;
	}

	public void setAuthor(String author) {
		this.author = author;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getImgPath() {
		return imgPath;
	}

	public void setImgPath(String imgPath) {
		this.imgPath = imgPath;
	}

	public String getMinImgPath() {
		return minImgPath;
	}

	public void setMinImgPath(String minImgPath) {
		this.minImgPath = minImgPath;
	}



	public String getExamine() {
		return examine;
	}

	public void setExamine(String examine) {
		this.examine = examine;
	}

	public boolean isCollected() {
		if (collected == 0)
			return false;
		else
			return true;
	}

	public void setCollected(boolean mesgCollected) {
		if (mesgCollected)
			this.collected = 1;
		else
			this.collected = 0;
	}

	public int getNtop() {
		return ntop;
	}

	public void setNtop(int ntop) {
		this.ntop = ntop;
	}

	public int getNdown() {
		return ndown;
	}

	public void setNdown(int ndown) {
		this.ndown = ndown;
	}

	public boolean getIstop() {
		if (this.istop == 1)
			return true;
		else
			return false;
	}

	public void setIstop(boolean isChecked) {
		if (isChecked)
			this.istop = 1;
		else
			this.istop = 0;
	}

	public boolean getIsdown() {
		if (this.isdown == 1)
			return true;
		else
			return false;
	}

	public void setIsdown(boolean isChecked) {
		if (isChecked)
			this.isdown = 1;
		else
			this.isdown = 0;
	}

	public Message() {

	}

	public Message(String id, String mesgType, String authorIcon, String authorName, String content, String minImgPath,
			String imgPath, int ntop, int ndown, int collected, int istop, int isdown) {
		this.id = id;
		this.mesgType = mesgType;
		this.authorIcon = authorName;
		this.author = authorName;
		this.content = content;
		this.minImgPath = minImgPath;
		this.imgPath = imgPath;
		this.ntop = ntop;
		this.collected = collected;
		this.ndown = ndown;
		this.istop = istop;
		this.isdown = isdown;
	}

	@Override
	public int describeContents() {
		return 0;
	}

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		dest.writeString(id);
		dest.writeString(mesgType);
		dest.writeString(authorIcon);
		dest.writeString(author);
		dest.writeString(content);
		dest.writeString(minImgPath);
		dest.writeString(imgPath);
		dest.writeInt(ntop);
		dest.writeInt(ndown);
		dest.writeInt(collected);
		dest.writeInt(istop);
		dest.writeInt(isdown);
		dest.writeInt(status);
	}

	public static final Parcelable.Creator<Message> CREATOR = new Creator<Message>() {
		// 实现从source中创建出类的实例的功能
		@Override
		public Message createFromParcel(Parcel source) {
			Message mesg = new Message();
			mesg.id = source.readString();
			mesg.mesgType = source.readString();
			mesg.authorIcon = source.readString();
			mesg.author = source.readString();
			mesg.content = source.readString();
			mesg.minImgPath = source.readString();
			mesg.imgPath = source.readString();
			mesg.ntop = source.readInt();
			mesg.ndown = source.readInt();
			mesg.collected = source.readInt();
			mesg.istop = source.readInt();
			mesg.isdown = source.readInt();
			mesg.status=source.readInt();
			return mesg;
		}

		// 创建一个类型为T，长度为size的数组
		@Override
		public Message[] newArray(int size) {
			return new Message[size];
		}
	};

}
